package com.nefu.softlab.xjwc.service;

import com.nefu.softlab.xjwc.model.Score;
import com.nefu.softlab.xjwc.model.vo.ScoreVo;
import com.nefu.softlab.xjwc.utils.XJWCException;

import java.util.List;
import java.util.Map;

/**
 * @author : Ar1es
 * @date : 2020/2/8
 * @since : Java 8
 */
public interface ScoreService {

    /**
     * 根据userId和projectId查询记录是否存在
     * @param score
     * @return
     */
    double selectScoreIsExist(Score score) throws XJWCException;


    /**
     *
     * @param score
     * @return
     * @throws XJWCException
     */
    double selectOverScoreTag(Score score) throws XJWCException;

    /**
     * 根据项目查询分数列表
     * @param score
     * @return
     */
    List<Map<String, Object>> selectScoreByProject(Score score) throws XJWCException;

    /**
     * 根据项目查看多少人已经评分
     * @param score
     * @return
     */
    int selectScoreNumberByProject(Score score) throws XJWCException;

    /**
     * 查看项目评分是否完成
     * @param score
     * @return
     * @throws XJWCException
     */
    boolean selectScoreIsOver(Score score) throws XJWCException;

    /**
     * 添加评分
     * @param scoreVo
     * @return
     */
    int insertScore(ScoreVo scoreVo) throws XJWCException;

    /**
     * 修改评分
     * @param score
     * @return
     */
    int updateScore(ScoreVo score) throws XJWCException;

    /**
     * 删除评分
     * @param score
     * @return
     */
    int deleteScore(Score score) throws XJWCException;


    /**
     * 那个坑爹的算法
     * naoyixie
     * @return
     * @throws XJWCException
     */
    String calculateScore(Score score) throws XJWCException;


    /**
     * 根据activityId删除分数
     * @return
     * @throws XJWCException
     */
    int deleteScoreByActivityId(Integer activityId) throws XJWCException;

}
